Carbon


MPCreateSemaphore

Header: Multiprocessing.h Carbon status: Supported

Creates a semaphore.

OSStatus MPCreateSemaphore (
    MPSemaphoreCount maximumValue, 
    MPSemaphoreCount initialValue, 
    MPSemaphoreID *semaphore
);
maximumValue

The maximum allowed value of the semaphore.

initialValue

The initial value of the semaphore.

semaphore

On return, semaphore contains the ID of the newly–created semaphore.

function result

A result code.

DISCUSSION

If you want to create a binary semaphore, you can call the macro MPCreateBinarySemaphore (MPSemaphoreID *semaphore) instead, which simply calls MPCreateSemaphore with both maximumValue and initialValue set to 1.

Also see the function MPDeleteSemaphore.

VERSION NOTES

Introduced with Multiprocessing Services 1.0.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)